import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;

/**
 * @author fenge
 */
public class Sub extends Super {

    public static void main(String[] args) {
        System.out.println(Runtime.getRuntime().totalMemory() / 1024 / 1024);
        System.out.println(Runtime.getRuntime().maxMemory() / 1024 / 1024);
        Sub sub = new Sub();
        sub.test1();
        Method[] declaredMethods = sub.getClass().getMethods();
        System.out.println(declaredMethods);
//        HashMap
        ArrayList<Integer> arrayList = new ArrayList<>();
        arrayList.add(1);
        arrayList.add(2);
        arrayList.add(3);
        arrayList.add(4);
        arrayList.add(5);
        Iterator iterator = arrayList.iterator();
        /*for (Integer integer : arrayList) {
            iterator.remove();
        }*/
        while (iterator.hasNext()){
            Object next = iterator.next();
            arrayList.remove(next);
        }
    }
}
